const getStore = (key: string) => {
  return JSON.parse(localStorage.getItem(key) || '{}')
}

const setStore = (key: string, value: any) => {
  localStorage.setItem(key, JSON.stringify(value))
}

const removeStore = (key: string) => {
  localStorage.removeItem(key)
}

const clearStore = () => {
  localStorage.clear()
}

const utils = {
  getStore,
  setStore,
  removeStore,
  clearStore
}

export default utils
